package com.hero.tweaks.util;

import android.os.Bundle;

import com.hero.tweaks.R;
import com.hero.tweaks.ui.activities.MainActivity;
import com.hero.tweaks.ui.fragments.AboutRenovate;
import com.hero.tweaks.ui.fragments.App;
import com.hero.tweaks.ui.fragments.Interface;
import com.hero.tweaks.ui.fragments.Statusbar;
import com.hero.tweaks.ui.fragments.Tools;
import com.htc.fragment.widget.CarouselFragment;
import com.htc.fragment.widget.CarouselHost;
import com.htc.fragment.widget.CarouselTabSpec;

public class Carousel extends CarouselFragment {
	public Carousel() {
		super(MainActivity.AUTHORITY);
		requestCarouselFeature(CarouselFragment.FEATURE_CUSTOM_TITLE);
	}

	private void addTabAbout(CarouselHost host, String tag, int str) {
		if (Helpers.getROMVersion().contains("Renovate")) {
			host.addTab(getActivity(), new CarouselTabSpec(tag, str, AboutRenovate.class.getName()));
		}
	}
	
	private void addTabStatusbar(CarouselHost host, String tag, int str) {
		host.addTab(getActivity(), new CarouselTabSpec(tag, str, Statusbar.class.getName()));

	}
	
	private void addTabLauncher(CarouselHost host, String tag, int str) {
	host.addTab(getActivity(), new CarouselTabSpec(tag, str, Interface.class.getName()));

    }
	
	private void addTabApp(CarouselHost host, String tag, int str) {
		host.addTab(getActivity(), new CarouselTabSpec(tag, str, App.class.getName()));

	}


	/*private void addTabPie(CarouselHost host, String tag, int str) {
		host.addTab(getActivity(), new CarouselTabSpec(tag, str, PieControls.class.getName()));

	}*/
	
	private void addTabTools(CarouselHost host, String tag, int str) {
		host.addTab(getActivity(), new CarouselTabSpec(tag, str, Tools.class.getName()));

	}

	/*private void addTabColors(CarouselHost host, String tag, int str) {
		host.addTab(getActivity(), new CarouselTabSpec(tag, str, Colors.class.getName()));

	}

	private void addTabLockscreen(CarouselHost host, String tag, int str) {
		host.addTab(getActivity(), new CarouselTabSpec(tag, str, Lockscreen.class.getName()));

	}*/

	public void enterCarouselEditMode() {
		enterEditMode();
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);

		final CarouselHost host = getCarouselHost();

		addTabAbout(host, "about", R.string.t_about);
		addTabStatusbar(host, "statusbar", R.string.t_statusbar);
		addTabLauncher(host, "interface", R.string.t_interface);
		addTabApp(host, "app", R.string.t_app);
		//addTabPie(host, "pie", R.string.t_pie);
		addTabTools(host, "tools", R.string.t_tools);
		//addTabLockscreen(host, "lockscreen", R.string.t_lockscreen);
		//addTabColors(host, "colors", R.string.t_colors);
		
		
	}

}
